package com.example.controller;

import com.example.entity.ElastStudent;
import com.example.service.ElastService;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class ElastController {


    //如果eslast4.2版本不行，就exlusion他，然后给他制定版本
    @Autowired
    private ElastService elastService;
    @RequestMapping(value = "es/get")
    public List<ElastStudent> getStudent(@RequestParam @ApiParam("studentNo") String name)
    {
        return elastService.getTest(name);
    }
    @RequestMapping(value = "es/insert" ,method = RequestMethod.POST)
    public void insertStudent(@RequestBody ElastStudent elastStudent)
    {
         elastService.addElastStudent(elastStudent);
    }
}
